package com.dc.refactoring._3_重新组织数据._7_ChangeBidirectionalAssociationToUnidirectional.step2;

public class Order {
    private double grossPrice = 0;

    public double getGrossPrice() {
        return grossPrice;
    }

    public void setGrossPrice(double grossPrice) {
        this.grossPrice = grossPrice;
    }

    // 如果需要使用 customer ,参数传入即可
    public double getDiscountedPrice(Customer customer) {
        return getGrossPrice() * (1 - customer.getDiscount());
    }
}
